<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BabyOS: b_utils.c Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="2.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">BabyOS
   &#160;<span id="projectnumber">V1.1.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_b9223522bb56aee4ab59f7ba381d2163.html">bos</a></li><li class="navelem"><a class="el" href="dir_f8a0fa7de2fa8ec1cbca46d8cda2da54.html">hal</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">b_utils.c</div>  </div>
</div><!--header-->
<div class="contents">
<a href="b__utils_8c.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="comment">/*Includes ----------------------------------------------*/</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="b__utils_8h.html">b_utils.h</a>&quot;</span>   </div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;<span class="keyword">extern</span> <span class="keyword">volatile</span> uint32_t <a class="code" href="group___u_t_i_l_s___private___variables.html#gaf4192a6f2331016cae3bcd9e5f2c7e20">bSysTick</a>;</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;</div><div class="line"><a name="l00106"></a><span class="lineno"><a class="line" href="group___u_t_i_l_s___exported___functions.html#gaa182576041a2f75efbe74e38ef0a5be2">  106</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___u_t_i_l_s___exported___functions.html#gaa182576041a2f75efbe74e38ef0a5be2">bHalDelayMS</a>(uint32_t xms)</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;{</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;  uint32_t tickstart = <a class="code" href="group___u_t_i_l_s___private___variables.html#gaf4192a6f2331016cae3bcd9e5f2c7e20">bSysTick</a>;</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;  uint32_t wait = xms * <a class="code" href="b__config_8h.html#ae2076738df8e2eff78366a0187291367">_TICK_FRQ_HZ</a> / 1000;</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;  <span class="keywordflow">while</span> ((<a class="code" href="group___u_t_i_l_s___private___variables.html#gaf4192a6f2331016cae3bcd9e5f2c7e20">bSysTick</a> - tickstart) &lt; wait)</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;  {</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    ;</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;  }</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;}</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;</div><div class="line"><a name="l00117"></a><span class="lineno"><a class="line" href="group___u_t_i_l_s___exported___functions.html#ga7e7ef920e4c7a4c6d27a646cb3c88a8d">  117</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___u_t_i_l_s___exported___functions.html#ga7e7ef920e4c7a4c6d27a646cb3c88a8d">bHalDelayUS</a>(uint32_t xus)</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;{</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    <span class="keywordflow">while</span>(xus--)</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;    {</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;        __nop();</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    }</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;}</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;</div><div class="line"><a name="l00125"></a><span class="lineno"><a class="line" href="group___u_t_i_l_s___exported___functions.html#gac8e750b2b439b1cc756a4076503738e4">  125</a></span>&#160;uint32_t <a class="code" href="group___u_t_i_l_s___exported___functions.html#gac8e750b2b439b1cc756a4076503738e4">bHalGetTick</a>()</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;{</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="group___u_t_i_l_s___private___variables.html#gaf4192a6f2331016cae3bcd9e5f2c7e20">bSysTick</a>;</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;}</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;<span class="comment">/************************ Copyright (c) 2019 Bean *****END OF FILE****/</span></div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;</div><div class="ttc" id="group___u_t_i_l_s___exported___functions_html_gac8e750b2b439b1cc756a4076503738e4"><div class="ttname"><a href="group___u_t_i_l_s___exported___functions.html#gac8e750b2b439b1cc756a4076503738e4">bHalGetTick</a></div><div class="ttdeci">uint32_t bHalGetTick()</div><div class="ttdef"><b>Definition:</b> <a href="b__utils_8c_source.html#l00125">b_utils.c:125</a></div></div>
<div class="ttc" id="group___u_t_i_l_s___exported___functions_html_ga7e7ef920e4c7a4c6d27a646cb3c88a8d"><div class="ttname"><a href="group___u_t_i_l_s___exported___functions.html#ga7e7ef920e4c7a4c6d27a646cb3c88a8d">bHalDelayUS</a></div><div class="ttdeci">void bHalDelayUS(uint32_t xus)</div><div class="ttdef"><b>Definition:</b> <a href="b__utils_8c_source.html#l00117">b_utils.c:117</a></div></div>
<div class="ttc" id="b__utils_8h_html"><div class="ttname"><a href="b__utils_8h.html">b_utils.h</a></div></div>
<div class="ttc" id="group___u_t_i_l_s___private___variables_html_gaf4192a6f2331016cae3bcd9e5f2c7e20"><div class="ttname"><a href="group___u_t_i_l_s___private___variables.html#gaf4192a6f2331016cae3bcd9e5f2c7e20">bSysTick</a></div><div class="ttdeci">volatile uint32_t bSysTick</div><div class="ttdef"><b>Definition:</b> <a href="b__hal_8c_source.html#l00077">b_hal.c:77</a></div></div>
<div class="ttc" id="b__config_8h_html_ae2076738df8e2eff78366a0187291367"><div class="ttname"><a href="b__config_8h.html#ae2076738df8e2eff78366a0187291367">_TICK_FRQ_HZ</a></div><div class="ttdeci">#define _TICK_FRQ_HZ</div><div class="ttdef"><b>Definition:</b> <a href="b__config_8h_source.html#l00050">b_config.h:50</a></div></div>
<div class="ttc" id="group___u_t_i_l_s___exported___functions_html_gaa182576041a2f75efbe74e38ef0a5be2"><div class="ttname"><a href="group___u_t_i_l_s___exported___functions.html#gaa182576041a2f75efbe74e38ef0a5be2">bHalDelayMS</a></div><div class="ttdeci">void bHalDelayMS(uint32_t xms)</div><div class="ttdef"><b>Definition:</b> <a href="b__utils_8c_source.html#l00106">b_utils.c:106</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>
